package com.pqc.tbk.service.order;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pqc.tbk.dao.order.OrderDao;
import com.pqc.tbk.entity.order.Order;
import com.pqc.tbk.utils.Pager;

/**
 * 
 * @author long, create on 2012-7-19 下午2:04:50
 * 
 */
@Service
public class OrderServiceImpl implements OrderService {

	private OrderDao orderDao;
	private final String ORDER_BY = " order by pay_time desc";

	@Override
	public Pager<Order> getOrders(final Pager<Order> pager, final long uid) {
		final String search = " and uid=" + uid + ORDER_BY;
		return orderDao.getOrders(pager, search);
	}

	@Override
	public Long getCountByUid(final long uid) {
		return orderDao.getCountByUID(uid);
	}

	@Autowired
	public void setOrderDao(final OrderDao orderDao) {
		this.orderDao = orderDao;
	}

}
